home *** CD-ROM | disk | FTP | other *** search
- onClipEvent(load){
- function update()
- {
- if(swooping)
- {
- if(first_time)
- {
- save_x = this._x;
- save_y = this._y;
- first_time = false;
- dummy_x = 0;
- dummy_y = 0;
- }
- dummy_x += _level0.dirn * _level0.step;
- _level0.dummy._x = dummy_x;
- if(count == 0)
- {
- if(50 < random(100))
- {
- direction = -1;
- }
- else
- {
- direction = 1;
- }
- limit = 10 + random(10);
- count = 1;
- }
- else
- {
- count++;
- if(limit < count)
- {
- count = 0;
- }
- }
- this._x += 5 * direction;
- this._y += 5;
- if(350 < this._y)
- {
- swooping = false;
- this._y = dummy_y + save_y;
- this._x = dummy_x + save_x;
- count = 0;
- first_time = true;
- }
- temp_x = dummy_x + save_x;
- if((450 < temp_x or temp_x < 10) and status == "ok")
- {
- trace("changed direction - with swooper !!");
- _level0.change_dirn = true;
- status = "change";
- }
- else
- {
- status = "ok";
- }
- }
- else
- {
- this._x += _level0.dirn * _level0.step;
- this.play();
- if((450 < this._x or this._x < 10) and status == "ok")
- {
- _level0.change_dirn = true;
- status = "change";
- }
- else
- {
- status = "ok";
- }
- }
- }
- status = "ok";
- swooping = false;
- count = 0;
- first_time = true;
- }
-